/**
 *
 */
package com.telkomsigma.spring.hibernate.persistence.dao;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import com.telkomsigma.spring.hibernate.common.PaginatedResult;
import com.telkomsigma.spring.hibernate.persistence.domain.TPlayer;
import com.telkomsigma.spring.hibernate.persistence.domain.TeamCapt;


/**
 * @author Adi
 *
 */
@Repository
public class CaptainDaoImpl extends HibernateDaoSupport implements CaptainDao {

	private final Class<TeamCapt> persistentClass = TeamCapt.class;
	
	private static final Log log = LogFactory.getLog(CaptainDaoImpl.class);
	
	@Autowired
	public CaptainDaoImpl(SessionFactory sessionFactory) {
		setSessionFactory(sessionFactory);
	}
	
	public CaptainDaoImpl() {
		super();
	}

	public CaptainDaoImpl(Class<TeamCapt> persistentClass) {
		super();
	}

	public Class<TeamCapt> getPersistentClass() {
		return persistentClass;
	}
	
	/* (non-Javadoc)
	 * @see com.common.CoreDao#insert(java.lang.Object)
	 */
	

	/* (non-Javadoc)
	 * @see com.common.CoreDao#update(java.lang.Object)
	 */
	
	public TeamCapt update(TeamCapt detachedInstance) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#remove(java.lang.Object)
	 */
	
	public Boolean remove(TeamCapt persistentInstance) {
		log.debug("deleting " + this.persistentClass.getName() + " instance");
		try {
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
			return true;
		} catch (RuntimeException re) {
			log.error("delete failed", re);
			throw re;
		}
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#removeList(java.util.List)
	 */
	
	public Boolean removeList(List<TeamCapt> list) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findById(java.lang.Integer)
	 */
	
	public TeamCapt findById(Integer id) {
		log.debug("getting " + this.persistentClass.getName()
				+ " instance with id: " + id);
		try {
			TeamCapt instance = (TeamCapt) getHibernateTemplate().get(
					this.persistentClass.getName(), id);
			return instance;
		} catch (RuntimeException re) {
			log.error("find " + this.persistentClass.getName()
					+ " by id failed", re);
			throw re;
		}
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findByExample(java.lang.Object, int[])
	 */
	
	public List<TeamCapt> findByExample(TeamCapt instance,
			int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findByProperty(java.lang.String, java.lang.Object, int[])
	 */
	
	public List<TeamCapt> findByProperty(String propertyName, Object value,
			int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findAll(int[])
	 */
	
	public List<TeamCapt> findAll(int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findLikeProperty(java.lang.String, java.lang.Object, int[])
	 */
	
	public List<TeamCapt> findLikeProperty(String propertyName, Object value,
			int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findLikeMapOfProperties(java.util.Map, int[])
	 */
	
	public List<TeamCapt> findLikeMapOfProperties(
			Map<String, Object> propertiesMap, int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#findByMapOfProperties(java.util.Map, int[])
	 */
	
	public List<TeamCapt> findByMapOfProperties(
			Map<String, Object> propertiesMap, int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#countAll()
	 */
	
	public Integer countAll() {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#countLikeProperty(java.lang.String, java.lang.Object)
	 */
	
	public Integer countLikeProperty(String propertyName, Object value) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#countByProperty(java.lang.String, java.lang.Object)
	 */
	
	public Integer countByProperty(String propertyName, Object value) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#countLikeMapOfProperties(java.util.Map)
	 */

	public Integer countLikeMapOfProperties(Map<String, Object> propertiesMap) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#countByMapOfProperties(java.util.Map)
	 */
	
	public Integer countByMapOfProperties(Map<String, Object> propertiesMap) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#paginateLikeMapOfProperties(java.util.Map, int[])
	 */
	
	public PaginatedResult<TeamCapt> paginateLikeMapOfProperties(
			Map<String, Object> propertiesMap, int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#paginateAll(int[])
	 */

	public PaginatedResult<TeamCapt> paginateAll(int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.common.CoreDao#paginateByMapOfProperties(java.util.Map, int[])
	 */

	
	public PaginatedResult<TeamCapt> paginateByMapOfProperties(
			Map<String, Object> propertiesMap, int... rowStartIdxAndCount) {
		// TODO Auto-generated method stub
		return null;
	}

	
	public TeamCapt insert(TeamCapt transientInstance) {
		// TODO Auto-generated method stub
		return null;
	}

}
